<template>
  <div class="index-container">
    <div class="header_active">
      <img src="@/assets/images/activeheader.png" alt="" class='headerimage'>
    </div>
    <div class="activebody ">
      <div class="flexcolumn bodybg">
        <!-- <img src="@/assets/images/body_whitebg.png" alt="" class="postiion_img"> -->
        <div class="detailinfo">活动规则</div>
        <template v-if="title||content">
            <div class="title">{{title}}</div>
            <div class="content f_14" v-html='content'></div>
        </template>
        
      </div>
    </div>
  </div>
</template>

<script>
import { getData } from '@/api/home';
export default {
  data() {
    return {
      loading:false,
      title:'',
      content:""
    }
  },

  created(){
    this.getData();
  },
  methods: {

    // getProvince(){
    //   if(type==1){ //省份
    //     this.getDicts('/task/index/province').then(res=>{
    //       this.province = res.data;
    //     });
    //   }
    //   if(type==2){ //城市
    //     getCitys(params).then(res=>{
    //       this.citys = res.data;
    //     })
    //   }
    //   if(type==3){ //地区
    //     getRegions(params).then(res=>{
    //       this.region = res.data;
    //     })
    //   }
    // },

    decodeHTM(html){
      var txt =document.createElement('textarea');
      txt.innerHTML = html;
      return txt.value;
    },

    getData(){
      getData().then(res=>{
        if(res.code == 1){
        //   this.coin = 0
        this.title = res.data.title;
        this.content = this.decodeHTM(res.data.text);
        }
      })
    },

    goPage(page){
      this.$router.push({name:page})
    },

    cancle(){
      this.$router.back();
    },

  }
}
</script>

<style lang="scss" scoped>
.index-container {
  width: 100%;
  min-height: 100vh;
  background:url("~@/assets/images/activebg.png") center no-repeat;
  background-size: cover;
  position: relative;
}
.header_active{
  height: 360px;
  width: 100%;
}
.activebody{
  width: 100%;
  padding: 30px;
  padding-bottom: 0;
  min-height: calc(100vh - 360px);
}
.headerimage{
  width: 100%;
  height: 100%;
}
.bodybg{
  background: url('~@/assets/images/body_whitebg.png') center no-repeat;
  background-size: contain;
  background-size:100% 100%;
  // background-attachment:fixed;
  min-height: calc(100vh - 420px);
  padding:30px;
  // padding-bottom: 0;
  position: relative;
}
// .postiion_img{
//   position: absolute;
//   top: 0;
//   bottom: 0;
//   width: 100%;
// }
.detailinfo{
  width: 466px;
  height: 86px;
  background:url('~@/assets/images/activebtn.png') center no-repeat;
  background-size: contain;
  margin:0 auto;
  margin-top: -43px;
  color: white;
  text-align: center;
  line-height: 80px;
  font-size: 40px;
}
.add_icon{
 display: inline-block;
 margin-left: 12px; 
 line-height: 70px;
}
.delicon{
  color: red;
}
.iconaddbtn{
  border: 1px solid #1989fa;
  font-size: 28px;
  padding: 10px 20px;
  color: #1989fa;
  border-radius: 10px;
}
.loadbtn{
    margin-top: 60px;
    width: 220px;
    height: 80px;
    background: url('~@/assets/images/activebtnsub.png') center no-repeat ;
    background-size: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 0;
    color: #000;
}

.canclebtn{
  background: #fff;
  border: 1px solid #727272;
  color: #747474;
  border-radius: 16px;
  margin-top: 30px;
  margin-bottom: 30px;
}
.title{
    margin-top: 30px;
    font-size: 32px;
    color: #000;
    text-align: center;
}

</style>
<style lang="scss">
.content {
  img{
    max-width: 100%;
  }
  code, pre {
    background-color: #f0f0f0;
    border-radius: 3px;
  }
  pre.ql-syntax{
    background-color: #23241f;
    color: #f8f8f2;
    overflow: visible;
  }
  pre {
    white-space: pre-wrap;
    margin-bottom: 5px;
    margin-top: 5px;
    padding: 5px 10px;
  }
  li:not(.ql-direction-rtl)::before {
    margin-left: -0.5em;
    margin-right: 0.3em;
    text-align: right;
  }
  ol li:before {
    content: counter(list-0, decimal) '. ';
  }
  li::before {
    display: inline-block;
    white-space: nowrap;
    width: 1.2em
  }
  ol li{
    counter-reset:list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9;
    counter-increment: list-0;
  }
  ul > li::before {
    content: '\2022';
  }
  li:not(.ql-direction-rtl)::before {
    margin-left: -0.5em;
    margin-right: 0.3em;
    text-align: right;
  }
}

</style>